import FlexSearch from "flexsearch";

const index = new FlexSearch.Index({
  language: "en",
  stemmer: {
    中南林业科技大学: "林科大",
    run: "runing",
  },
  filter: ["is", "啊"],
});

index.add(0, "hello i am Jack. i runing");
index.add(1, "this is best tester, jack");

index.export((key, data) => {
  console.log("导出:", key, data);
});
console.log("`jack`搜索结果", index.search("jack"));
console.log("`tester`搜索结果", index.search("tester"));
console.log("`is`搜索结果", index.search("is"));
console.log("`this`搜索结果", index.search("this"));
console.log("`run`搜索结果", index.search("run"));
